#!/bin/bash
source /etc/profile

mkdir -p /home/marvin/dashboard_job/logs/`date +%Y-%m-%d`
echo "------------------------------------------------------------------------"
start=`date +%s`
echo "开始执行hql，start dashboardhql"`date +"%Y-%m-%d %H:%M"`
sh /home/marvin/dashboard_job/hive/dashboardhql.sh >>/home/marvin/dashboard_job/logs/`date +%Y-%m-%d`/dashboardhql.loglog 2>&1
end=`date +%s`
usetime=`expr $end - $start`
echo "hql结束，end dashboardhql,usetime:$usetime"

echo "------------------------------------------------------------------------"
start=`date +%s`
echo "开始执行向mysql导数据，start hive to mysql"`date +"%Y-%m-%d %H:%M"`
#sh /home/marvin/dashboard_job/delete_or_truncate/dashboardtruncate.sh >>/home/marvin/dashboard_job/logs/`date +%Y-%m-%d`/dashboardtruncate.loglog 2>&1
sh /home/marvin/dashboard_job/sqoop/dashboardhqlsqoop.sh >>/home/marvin/dashboard_job/logs/`date +%Y-%m-%d`/dashboardhqlsqoop.loglog 2>&1
end=`date +%s`
usetime=`expr $end - $start`
echo "hive to mysql结束,end,usetime:$usetime"
